package com.yisen.dasan.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date;


public class TimeUtils {
    /**
     * 获取时间戳
     * @return
     */
    public static long getSecondTimestampTwo() {
        Date date = new Date();
        long time=date.getTime();
        //String timestamp = String.valueOf(date.getTime() / 1000);
        //return Integer.parseInt(timestamp);
        return time;
    }
    public static int getWeek(long timestamp){
        Date time=new Date(timestamp);
        LocalDateTime localDateTime = LocalDateTime.ofInstant(time.toInstant(), ZoneOffset.ofHours(8));
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
        return dayOfWeek.getValue();
    }
}
